<?php
class phoneModule extends Module {
	
	/*
	 * 在构造函数中装载所依赖的类或其他文件
	*/
	function __construct() {
		$this->includePhp('phone', 'phone');
	}
	
	/*
	 * 调用插件资源
	*/
	public function call($user, $method, $param) {
		switch ($method) {
			case 'sendPhoneCode':
				$phone = $param->phone;
				$module = $param->module;
				$recall = $param->recall;
				return phone::sendPhoneCode($phone,$module,$recall);
			case 'sendSms':
				$phone = $param->phone;
				$module = $param->module;
				$status = $param->status;
				$message = $param->message;
				$templateParam = $param->templateParam;
				return phone::sendSms($phone,$module,$status,$message,$templateParam);
			case 'verifyPhoneCode':
				$phone = $param->phone;
				$code = $param->code;
				$recall = $param->recall;
				return phone::verifyPhoneCode($phone,$code,$recall);
			case 'verifyPhone':
				$phone = $param->phone;
				return phone::verifyPhone($phone);
		}
	}
}


$module = new phoneModule();
Module::addModule($module);